package com.ee.chat.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ee.chat.common.entity.SysOrder;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper接口
 * </p>
 *
 * @author Shane
 * @since 2019-07-11
 */
public interface SysOrderMapper extends BaseMapper<SysOrder> {
    /**
     * 根据订单号查询系统订单
     * @Author Shane
     * @Date 2019/10/5 5:01
     * @param
     * @return
     */
    SysOrder selectByOrderNumber(@Param("orderNumber") String orderNumber);

    SysOrder selectByTransactionId(@Param("transactionId") String transactionId);

    /**
     * 查询充值提现交易统计数据
     * @Author AppiJ
     * @Date 2020/5/14 12:09
     * @param format     月--%Y-%m-%d  年--%Y-%m
     * @param startTime  开始时间
     * @return
     */
    List<Map<String, Object>> queryTransactionStatics(@Param("format") String format, @Param("startTime") String startTime);

    /**
     * 获取总充值和提现金额
     * @Author AppiJ
     * @Date 2020/9/26 17:35
     * @param
     * @return
     */
    Map<String, Object> getRechargeAndWithdrawTotal();

    /**
     * 获取累计和今日提现金额
     * @Author AppiJ
     * @Date 2020/9/28 18:06
     * @param
     * @return
     */
    Map<String, Object> getWithdrawTotal(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    /**
     * 获取渠道指定时间的累计收款金额
     * @param configId
     * @param beginTime
     * @param endTime
     * @return
     */
    Integer getTotalAmount(@Param("configId") Integer configId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);
}